﻿
/*----------------------------------------------------------------//
// 文件名：MoReportAudit.cs
// 文件功能描述：实体 MoReportAudit.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoReportAudit
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoReportAudit
    /// </summary>
    public partial class MoReportAudit : ICloneable
    {
        #region 表ReportAudit的字段
        private string raId;
        private string reportId;
        private string auditorId;
        private string flowCode;
        private int beginStatus;
        private int endStatus;
        private DateTime auditTime;
        private DateTime createTime;
        private string auditInfo;
        #endregion

        #region 构造函数
        public MoReportAudit()
        {
            auditTime = new DateTime(1900, 1, 1); createTime = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoReportAudit(MoReportAudit item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoReportAudit(string raId, string reportId, string auditorId, string flowCode, int beginStatus, int endStatus, DateTime auditTime, DateTime createTime, string auditInfo)
        {
            this.raId = raId;
            this.reportId = reportId;
            this.auditorId = auditorId;
            this.flowCode = flowCode;
            this.beginStatus = beginStatus;
            this.endStatus = endStatus;
            this.auditTime = auditTime;
            this.createTime = createTime;
            this.auditInfo = auditInfo;
        }
        #endregion

        #region 表ReportAudit的字段属性
        /// <summary>
        /// RA_ID
        /// </summary>
        public string RaId
        {
            get { return raId; }
            set { raId = value; }
        }
        /// <summary>
        ///编号规则为NO. LDYYMMXXX，其中NO.LD为固定前缀，YY表示年份，MM代表月份，XXX代表当月第几个报告。XXX为业务组手工录入。此编号不能重复。报告编号做为唯一值编号贯穿于整个系统流程（包括财务、业务、试验、报告等各部门）
        /// </summary>
        public string ReportId
        {
            get { return reportId; }
            set { reportId = value; }
        }
        /// <summary>
        /// AUDITOR_ID
        /// </summary>
        public string AuditorId
        {
            get { return auditorId; }
            set { auditorId = value; }
        }
        /// <summary>
        /// FLOW_CODE
        /// </summary>
        public string FlowCode
        {
            get { return flowCode; }
            set { flowCode = value; }
        }
        /// <summary>
        /// BEGIN_STATUS
        /// </summary>
        public int BeginStatus
        {
            get { return beginStatus; }
            set { beginStatus = value; }
        }
        /// <summary>
        /// END_STATUS
        /// </summary>
        public int EndStatus
        {
            get { return endStatus; }
            set { endStatus = value; }
        }
        /// <summary>
        /// AUDIT_TIME
        /// </summary>
        public DateTime AuditTime
        {
            get { return auditTime; }
            set { auditTime = value; }
        }
        /// <summary>
        /// CREATE_TIME
        /// </summary>
        public DateTime CreateTime
        {
            get { return createTime; }
            set { createTime = value; }
        }
        /// <summary>
        /// AUDIT_INFO
        /// </summary>
        public string AuditInfo
        {
            get { return auditInfo; }
            set { auditInfo = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoReportAudit CopyTo(MoReportAudit item)
        {
            item.raId = this.raId;
            item.reportId = this.reportId;
            item.auditorId = this.auditorId;
            item.flowCode = this.flowCode;
            item.beginStatus = this.beginStatus;
            item.endStatus = this.endStatus;
            item.auditTime = this.auditTime;
            item.createTime = this.createTime;
            item.auditInfo = this.auditInfo;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoReportAudit mo = new MoReportAudit();
            mo.RaId = this.RaId;
            mo.ReportId = this.ReportId;
            mo.AuditorId = this.AuditorId;
            mo.FlowCode = this.FlowCode;
            mo.BeginStatus = this.BeginStatus;
            mo.EndStatus = this.EndStatus;
            mo.AuditTime = this.AuditTime;
            mo.CreateTime = this.CreateTime;
            mo.AuditInfo = this.AuditInfo;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoReportAudit NewReportAudit = obj as MoReportAudit;
                if (NewReportAudit == null)
                {
                    return false;
                }
                else
                {
                    if (NewReportAudit.RaId == this.RaId && NewReportAudit.ReportId == this.ReportId && NewReportAudit.AuditorId == this.AuditorId && NewReportAudit.FlowCode == this.FlowCode && NewReportAudit.BeginStatus == this.BeginStatus && NewReportAudit.EndStatus == this.EndStatus && NewReportAudit.AuditTime == this.AuditTime && NewReportAudit.CreateTime == this.CreateTime && NewReportAudit.AuditInfo == this.AuditInfo)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "RaId={0}/ReportId={1}/AuditorId={2}/FlowCode={3}/BeginStatus={4}/EndStatus={5}/AuditTime={6}/CreateTime={7}/AuditInfo={8}", raId, reportId, auditorId, flowCode, beginStatus, endStatus, auditTime, createTime, auditInfo);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["RA_ID"] != null && row["RA_ID"] != DBNull.Value)
            {
                this.RaId = (string)row["RA_ID"];
            }
            else
            {
                this.RaId = string.Empty;
            }
            if (row["Report_ID"] != null && row["Report_ID"] != DBNull.Value)
            {
                this.ReportId = (string)row["Report_ID"];
            }
            else
            {
                this.ReportId = string.Empty;
            }
            if (row["Auditor_ID"] != null && row["Auditor_ID"] != DBNull.Value)
            {
                this.AuditorId = (string)row["Auditor_ID"];
            }
            else
            {
                this.AuditorId = string.Empty;
            }
            if (row["Flow_Code"] != null && row["Flow_Code"] != DBNull.Value)
            {
                this.FlowCode = (string)row["Flow_Code"];
            }
            else
            {
                this.FlowCode = string.Empty;
            }
            if (row["Begin_Status"] != null && row["Begin_Status"] != DBNull.Value)
            {
                this.BeginStatus = (int)row["Begin_Status"];
            }
            else
            {
                this.BeginStatus = 0;
            }
            if (row["End_Status"] != null && row["End_Status"] != DBNull.Value)
            {
                this.EndStatus = (int)row["End_Status"];
            }
            else
            {
                this.EndStatus = 0;
            }
            if (row["Audit_Time"] != null && row["Audit_Time"] != DBNull.Value)
            {
                this.AuditTime = (DateTime)row["Audit_Time"];
            }
            else
            {
                this.AuditTime = DateTime.MinValue;
            }
            if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
            {
                this.CreateTime = (DateTime)row["Create_Time"];
            }
            else
            {
                this.CreateTime = DateTime.MinValue;
            }
            if (row["Audit_Info"] != null && row["Audit_Info"] != DBNull.Value)
            {
                this.AuditInfo = (string)row["Audit_Info"];
            }
            else
            {
                this.AuditInfo = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["RA_ID"] = this.RaId;
            row["Report_ID"] = this.ReportId;
            row["Auditor_ID"] = this.AuditorId;
            row["Flow_Code"] = this.FlowCode;
            row["Begin_Status"] = this.BeginStatus;
            row["End_Status"] = this.EndStatus;
            row["Audit_Time"] = this.AuditTime;
            row["Create_Time"] = this.CreateTime;
            row["Audit_Info"] = this.AuditInfo;
        }
        #endregion
    }
}
#endregion
